package org.cyhz.standardize.service;

import java.sql.SQLException;

import org.cyhz.util.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component("brandSeriesStandardizeService")
public class BrandSeriesStandardizeServiceImp implements
		BrandSeriesStandardizeService {

	@Value("#{configSettings['step.model']}")
	private int stepModel;

	@Autowired
	@Qualifier("bSStandardizeStep1Service")
	private BSStandardizeStepService BSStandardizeStep1Service;

	@Autowired
	@Qualifier("bSStandardizeStep2Service")
	private BSStandardizeStepService BSStandardizeStep2Service;

	@Override
	public void standardize() throws SQLException {

		if ((this.stepModel & 1) == 1) {
			Log.info("标准化步骤一>>>>>>>>>>>>>>>");
			BSStandardizeStep1Service.standardize();
		}

		if ((this.stepModel & 2) == 2) {
			Log.info("标准化步骤二>>>>>>>>>>>>>>>");
			BSStandardizeStep2Service.standardize();
		}

	}

}
